package com.wlz.bean;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @author wlz
 * @date 2022-05-23  8:56 下午
 */
@Component
public class MyOneFactoryBean implements FactoryBean<Car> {

	/**
	 *  返回 bean 的对象
	 * @return
	 * @throws Exception
	 */
	@Override
	public Car getObject() throws Exception {
		return new Car();
	}

	/**
	 *  返回bean 的类型
	 * @return
	 */
	@Override
	public Class<?> getObjectType() {
		return Car.class;
	}

	/**
	 *  是否为单例
	 * @return
	 */
	@Override
	public boolean isSingleton() {
		return true;
	}
}
